package com.huanxing.cloud.product.api.feign;

import com.huanxing.cloud.common.core.constant.SecurityConstants;
import com.huanxing.cloud.common.core.constant.ServiceNameConstants;
import com.huanxing.cloud.common.core.util.Result;
import com.huanxing.cloud.product.api.dto.GoodsSpuSalesVolumeReqDTO;
import com.huanxing.cloud.product.api.entity.GoodsSpu;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "remoteGoodsSpuService", value = ServiceNameConstants.PRODUCT_SERVICE)
public interface RemoteGoodsSpuService {

	@PostMapping("/app/goodsspu/update/sales-volume")
	Result<Boolean> updateSalesVolume(@RequestBody List<GoodsSpuSalesVolumeReqDTO> list,
			@RequestHeader(SecurityConstants.SOURCE) String source);

	@GetMapping("/app/goodsspu/{id}")
	Result<GoodsSpu> getBySpuId(@PathVariable("id") String id);

	@GetMapping("/app/goodsspu/list/{ids}")
	Result<List<GoodsSpu>> getBySpuIds(@PathVariable("ids") List<String> ids);

	@GetMapping("/app/goodsspu/getListByShopIds/{ids}")
	Result<List<GoodsSpu>> getSpuListByShopIds(@PathVariable("ids") List<String> ids);

}
